{% extends "base.html" %}
{% load i18n %}
{% load slice from shop %}
{% load staticfiles %}
{% load bootstrap_pagination from bootstrap3 %}

{% block title %}{% trans "Search results" context "Search page title" %} {{ block.super }}{% endblock %}

{% block breadcrumb %}
    {{ block.super }}
    {% for breadcrumb in breadcrumbs %}
        <li{% if forloop.last %} class="active"{% endif %}>
            {% if not forloop.last %}
                <a href="{{ breadcrumb.get_absolute_url }}">{{ breadcrumb }}</a>
            {% else %}
                <span>{{ breadcrumb }}</span>
            {% endif %}
        </li>
    {% endfor %}
{% endblock breadcrumb %}

{% block content %}
    <div class="row home__featured">
        <div class="col-12">
            {% if query and results %}
                <div class="row">
                    {% include "category/_items.html" with products=results %}
                </div>
                {% bootstrap_pagination results url=query_string %}
            {% else %}
                <div class="row no-results">
                    <div class="col-12">
                        <h2>{% trans "Search:" %} <strong>{{ query }}</strong></h2>
                        <svg data-src="{% static "images/pirate.svg" %}" width="360" height="360"/>
                        <p>{% trans "Sorry, no matches found for your request." context "Search without results text" %}</p>
                        <p>{% trans "Try again or shop new arrivals." context "Search without results text" %}</p>
                    </div>
                </div>
            {% endif %}
        </div>
    </div>
{% endblock content %}
